//
//  LZVerticalButton.m
//  LZBS
//
//  Created by 郝庆 on 16/6/11.
//  Copyright © 2016年 haoqing. All rights reserved.
//

#import "LZVerticalButton.h"

@implementation LZVerticalButton

- (void)setup
{
    self.titleLabel.textAlignment = NSTextAlignmentCenter;
}

- (instancetype)initWithFrame:(CGRect)frame
{
    if (self = [super initWithFrame:frame]) {
        [self setup];
    }
    return self;
}

- (void)awakeFromNib
{
    [self setup];
}

- (void)layoutSubviews
{
    [super layoutSubviews];
    
    // 调整图片
    self.imageView.lz_x = 0;
    self.imageView.lz_y = 0;
    self.imageView.lz_width = self.lz_width;
    self.imageView.lz_height = self.imageView.lz_width;
    
    // 调整文字
    self.titleLabel.lz_x = 0;
    self.titleLabel.lz_y = self.imageView.lz_height;
    self.titleLabel.lz_width = self.lz_width;
    self.titleLabel.lz_height = self.lz_height - self.titleLabel.lz_y;
}

@end
